package org.jash.learnmvp.news;

import org.jash.learnmvp.entity.CategoryEntity;
import org.jash.learnmvp.entity.NewsDetailEntity;
import org.jash.learnmvp.entity.NewsEntity;
import org.jash.learnmvp.entity.NewsPageEntity;

import java.util.List;

import io.reactivex.rxjava3.core.Observable;

public class ConStruct {
    public interface INewsModel {
        Observable<NewsEntity> getTopHot();
        Observable<CategoryEntity> getNewsCategory();
    }
    public interface INewsPresenter {
        void loadTopHot();
        void loadNewsCategory();
    }
    public interface INewsView {
        void success(List<NewsEntity.DataBean> list);
        void categorySuccess(List<CategoryEntity.DataBean> list);
        void failure(Throwable t);
    }
    public interface ICategoryModel {
        Observable<NewsPageEntity> getNewsByCategory(int type, int page, int size);
    }
    public interface ICategoryPresenter {
        void loadNewsByCategory(int type, int page, int size);
    }
    public interface ICategoryView {
        void newsSuccess(NewsPageEntity.DataBean page);
        void failure(Throwable t);
    }
    public interface INewsDetailModel {
        Observable<NewsDetailEntity> getNewsDetail(int id);
    }
    public interface INewsDetailPresenter {
        void loadNewsDetail(int id);
    }
    public interface INewsDetailView {
        void newsDetailSuccess(NewsDetailEntity.DataBean bean);
        void failure(Throwable t);
    }
}
